//POJ 1265
//C++ AC G++ WA
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <cassert>

using namespace std;

int gcd(const int &x,const int &y){
    if(y) return gcd(y,x%y);
    else return x;
}

inline int read(){
    char c;int r;bool f=0;
    for(c=getchar();c>'9'||c<'0';c=getchar()) if(c=='-') f=1;
    for(r=0;c<='9'&&c>='0';c=getchar()) r=r*10+c-'0';
    if(f) return -r;
    else return r;
}

inline int cross(const int &x1,const int &y1,const int &x2,const int &y2){return x1*y2-y1*x2;}

int main(){
    int T,kase;

    T=read();
    kase=1;
    while(T--){
        int x,y,m;
        int area,inter,border;
        x=y=0;
        border=0;
        area=0;
        m=read();
        while(m--){
            int dx,dy;
            dx=read();dy=read();
            border+=gcd(abs(dx),abs(dy));
            area+=cross(x,y,x+dx,y+dy);
            x+=dx;y+=dy;
        }
        assert(x==0&&y==0);
        inter=area/2.0+1-border/2;
        printf("Scenario #%d:\n",kase++);
        printf("%d %d %.1f\n\n",inter,border,area/2.0);
    }
    return 0;
}
